home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / fruit.swf / scripts / C_CoinsMenuCLASS.as < prev    next >
Text File  |  2006-01-17  |  2KB  |  76 lines

  1. _global.C_CoinsMenuCLASS = function()
  2. {
  3.    this.init();
  4. };
  5. C_CoinsMenuCLASS.prototype = new MovieClip();
  6. C_CoinsMenuCLASS.prototype.onLoad = function()
  7. {
  8.    this.coins = [0.25,1,5];
  9.    this.buttons = [this.c_0_25_btn,this.c_1_btn,this.c_5_btn];
  10.    this.coins_mc_array = [this.c_0_25_mc,this.c_1_mc,this.c_5_mc];
  11.    this.coins_names_array = ["25c","$1","$5"];
  12.    var c;
  13.    var i = 0;
  14.    while(i < this.coins.length)
  15.    {
  16.       c = this.buttons[i];
  17.       c.coin = this.coins[i];
  18.       c.addAlt("Use " + this.coins_names_array[i] + " coin\rfor betting");
  19.       c.onPress = function()
  20.       {
  21.          this.hideAlt();
  22.          this._parent.setCoin(this.coin);
  23.       };
  24.       c.useHandCursor = false;
  25.       i++;
  26.    }
  27.    this.setCoin(this.curCoin);
  28. };
  29. C_CoinsMenuCLASS.prototype.lock = function()
  30. {
  31.    this.onRelease = function()
  32.    {
  33.    };
  34.    this.useHandCursor = false;
  35. };
  36. C_CoinsMenuCLASS.prototype.unlock = function()
  37. {
  38.    delete this.onRelease;
  39.    delete this.useHandCursor;
  40. };
  41. C_CoinsMenuCLASS.prototype.setCoin = function(coin)
  42. {
  43.    if(!coin)
  44.    {
  45.       return undefined;
  46.    }
  47.    var a = this.coins_mc_array;
  48.    var i = 0;
  49.    while(i < this.buttons.length)
  50.    {
  51.       if(this.coins[i] == coin)
  52.       {
  53.          a[i]._brightness = 0;
  54.          a[i]._xscale = a[i]._yscale = 120;
  55.          this.arow_mc._x = a[i]._x;
  56.          this.buttons[i].enabled = false;
  57.       }
  58.       else
  59.       {
  60.          a[i]._brightness = -40;
  61.          a[i]._xscale = a[i]._yscale = 100;
  62.          this.buttons[i].enabled = true;
  63.       }
  64.       i++;
  65.    }
  66.    this.curCoin = coin;
  67.    var c = this.client;
  68.    c.client[c.handler](this.curCoin);
  69. };
  70. C_CoinsMenuCLASS.prototype.setChangeHandler = function(handler, client)
  71. {
  72.    this.client = {handler:handler,client:client};
  73. };
  74. ASSetPropFlags(_global,"C_CoinsMenuCLASS",131);
  75. Object.registerClass("C_CoinsMenuCLASS",C_CoinsMenuCLASS);
  76.